﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="TypeList.aspx.cs" Inherits="Medianamik.UI.TypeManagement.TypeList" MasterPageFile="../MasterPages/MedianamikModule.Master" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
    <a href="<%= AddURL %>" class="Action BtAjouter"><%=Resources("Medianamik_TypeManagement", "AddType") %></a>
    <a href="#" class="Action BtAnnuler-Inactif"><%=Resources("Medianamik_Global", "Cancel") %></a>
</asp:Content>

<asp:Content ID="MainTreeView" ContentPlaceHolderID="VariableRightPanel" runat="server">
   	<div class="BlocArbo">
   		<med:TreeView ID="TreeView" runat="server" Width="222" Height="295" EnableEmbeddedSkins="false" Skin="Medianamik"
   		OnNeedChildren="TreeView_NeedChildren"
   		OnNeedSelfAndParents="TreeView_NeedSelfAndParents"
   		/>
   	</div>
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
	<med:BreadcrumbTrail ID="bctFilAriane" Root="<%$ Resources: Medianamik_TypeManagement, TypeManagement %>" runat="server" CssClass="FilAriane" Url="TypeList.aspx" ParamName="basetypeid" />
	
	<telerik:RadGrid runat="server" ID="grdTypes" EnableEmbeddedSkins="false" Skin="Medianamik" 
	    AllowPaging="false" AutoGenerateColumns="false" OnItemCommand="grdTypes_ItemCommand" 
	    OnNeedDataSource="grdTypes_NeedDataSource" AllowMultiRowSelection="false" Width="100%">
		<MasterTableView DataKeyNames="ID">
			<Columns>
				<telerik:GridTemplateColumn>
				    <HeaderTemplate><asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: Medianamik_TypeManagement, TypeNameColumn %>"></asp:Literal></HeaderTemplate>
					<ItemTemplate>
					    <p><med:NodeTypeIcon runat="server" NodeTypeId='<%# Eval("ID") %>' 
					        /><asp:Literal runat="server" 
					        Text='<%# GetName(Container.DataItem as Medianamik.Core.NodeType)%>' /><asp:Literal runat="server" Text='<%#(bool)Eval("IsLanguageNeutral") ? 
					            @"&nbsp;&nbsp;<img src=""/Medianamik/images/Icones/Ico_ProprieteNeutreLangue.png"" 
					            class=""IconeLabel"" alt="""" />" : String.Empty%>' />
					            <asp:Literal runat="server" Text='<%# "(" + (Container.DataItem as Medianamik.Core.NodeType).GetInheritorsCount() + ", " + (Container.DataItem as Medianamik.Core.NodeType).GetTotalInheritorsCount() + ")"%>' /></p>
					</ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn HeaderText="<%$ Resources: Medianamik_TypeManagement, NodesOfAType %>">
				    <ItemTemplate>
				        <p><asp:Literal runat="server" Text='<%# (Container.DataItem as Medianamik.Core.NodeType).GetNodeCount() %>' /></p>
				    </ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn HeaderText="<%$ Resources: Medianamik_TypeManagement, TotalNodesOfAType %>">
				    <ItemTemplate>
				        <p><asp:Literal runat="server" Text='<%# (Container.DataItem as Medianamik.Core.NodeType).GetTotalNodeCount() %>' /></p>
				    </ItemTemplate>
				</telerik:GridTemplateColumn>
				<telerik:GridTemplateColumn HeaderStyle-Width="1%" HeaderText="Actions">
					<HeaderStyle HorizontalAlign="Center" />
					<ItemStyle CssClass="Actions" />
					<ItemTemplate>
						<table border="0" cellpadding="0" cellspacing="0" align="center">
							<tr>
								<td><med:EditLink runat="server" ID="btnEditProperty" NavigateUrl='<%# "typeManagement.aspx?" + Medianamik.Core.DefaultParamNames.TypeID + "=" + Eval("ID").ToString() %>' title="Modifier le type" /></td>
								<td><a href="<%# "propertylist.aspx?" + Medianamik.Core.DefaultParamNames.TypeID + "=" + Eval("ID") %>" title="Modifier les propriétés du type"><img src="../images/Icones/Ico_Page.gif" width="16" height="16" /></a></td>
								<td><a href="<%# "securitymanagement.aspx?" + Medianamik.Core.DefaultParamNames.TypeID + "=" + Eval("ID") %>" title="<%= Resources("Medianamik_SecurityManagement", "SecurityManagementTooltip") %>"><img src="/medianamik/images/Icones/Ico_SecuriteElement.png" width="16" height="16" /></a></td>
								<td><med:ConfirmedDeleteButton ID="btnDeleteType" Enabled='<%# !(Container.DataItem as Medianamik.Core.NodeType).HasNodes && !(Container.DataItem as Medianamik.Core.NodeType).HasChildren %>' CommandArgument='<%# Eval("ID") %>' CommandName="DeleteType" runat="server" ToolTip="<%$ Resources: Medianamik_Global, Action_DeleteTooltip %>" ConfirmText="<%$ Resources: Medianamik_ContentManagement, ConfirmDeleTypeText %>" /></td>
								<td><med:ConfirmedImageButton  runat="server" ID="btnGenTable" OnCommand="lnkGenTable_Click" CommandArgument='<%# Eval("ID")%>' ConfirmText='<%$ Resources: Medianamik_TypeManagement, ConfirmGenerateTableText %>' ImageUrl='/Medianamik/Images/Icones/Ico_Rafraichir.gif'></med:ConfirmedImageButton></td>
							</tr>
						</table>
					</ItemTemplate>
				</telerik:GridTemplateColumn>
			</Columns>
			<NoRecordsTemplate>
			    <asp:Literal ID="NoRecords" runat="server" Text="<%$ Resources: Medianamik_ContentManagement, NoRecordsToDisplay %>" />
			</NoRecordsTemplate>
		</MasterTableView>
		<ClientSettings EnableRowHoverStyle="true"></ClientSettings>
	</telerik:RadGrid>
	<br class="clearer" /> 
    <p class="Titre12pxBordure"><asp:Literal runat="server" Text="<%$ Resources:Medianamik_ContentManagement, FormTemplateCaption %>"></asp:Literal></p> 
    <ul id="Legende"> 
        <li class="Picto"> 
            <img src="/Medianamik/images/Icones/Ico_ProprieteNeutreLangue.png" class="IconeLabel" alt="" />&nbsp;&nbsp;<asp:Literal runat="server" Text="<%$ Resources: Medianamik_ContentManagement,LanguageNeutralCaptionForType %>"></asp:Literal>
        </li> 
    </ul> 
    <br class="clearer" />
	
</asp:Content>
